﻿@model Alma.Models.HomeModel
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewContext.Controller.ViewBag.Breadcrumb = null;
}

@*
@Html.ActionLink("Inscritpion", "Create", "User")
@Html.ActionLink("Connexion", "Connect", "User")
@Html.ActionLink("Editer le profil", "Edit", "User", new { id = 1 }, null)<br />
@Html.ActionLink("Créer un magasin", "Create", "Shop")<br />
@Html.ActionLink("Recherche", "Index", "Search")<br />
@Html.ActionLink("Admin", "Index", "Admin")

*@


<script language="javascript">

    var ua = navigator.userAgent;
    var checker =
        ua.match(/(iPhone|iPod|iPad)/) ||
        ua.match(/BlackBerry/) ||
        ua.match(/Android/);

    if (checker) {
        if (confirm("Voulez vous utiliser la version mobile du site ?")) {
            window.location = "@Url.Action("Profile", "Mobile")";
        }

    }

</script>

<img alt="Nous croyons en un monde plus équitable, plus respectueux de l’environmnent. Notre mission ? Vous proposer à prix attractifs des produits locaux, jour après jour." 
    src="@Url.Content("~/Content/images/intro.png")"
    style="margin: 20px 0 0 234px" />




<div class="fullcol">
@using (Html.BeginForm("Index", "Search", FormMethod.Get))
{
    <label style="display: block; font-size: 18px; color: #729DBA; font-weight: bold;" for="main-search-label">Que cherchez-vous&nbsp;?</label>
    @Html.TextBox("s", "", new Dictionary<string, object>() { { "style", "width: 457px; margin: 10px 0 0 0;" },
        { "name", "main-search-label" } })
}
<p>Vous pouvez aussi <a href="@Url.Action("Index", "Categories")">parcourir librement les catégories de produits</a> ou les <a href="@Url.Action("Index", "Shop")">points de vente près de chez vous</a>.</p>

<div style="height: 20px;"></div>
    <!-- TODO: similar products -->
    <h2>Catégories</h2>
    <ul class="products">
        @foreach (var cat in Model.catList)
        {
          <li>
                <a href="@Url.Action("Show", "Category", new { id = cat.ID })">
                <img src="@Url.Content("~/Content/images/" + @cat.ImageName)" alt="@cat.ImageName" />
                <span>@cat.Name</span></a>
                </li>
        }
        </ul>

      <h2>Nouveautés</h2>
    <!-- TODO: similar products -->

    <ul class="products">
        @foreach (var product in Model.Similars)
        {
            <li>
                <a href="@Url.Action("Show", "Product", new { id = product.ID })">
                <img src="@Url.Content(product.ImgUrl)" alt="@product.ImgUrl" />
                <span>@product.Name</span>
                
                </a>
            </li>
        }
    </ul>
</div>